package com.zzty.txj1.controller;


import com.zzty.txj1.entity.WxConfigInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/map")
public class MapController {
    private static final Logger logger = LoggerFactory.getLogger(MapController.class);

    @RequestMapping("/getConfig")
    public WxConfigInfo getWxConfig(HttpServletRequest request){
        WxConfigInfo wxConfigInfo =(WxConfigInfo)request.getSession().getAttribute("wxConfigInfoMap");
        logger.info("----------openId is : "+wxConfigInfo.toString());
        return wxConfigInfo;
    }
    @RequestMapping("/getOpenId")
    public Map getOpenId(HttpServletRequest request){
        String openId =(String)request.getSession().getAttribute("openId");
        logger.info("----------openId is : "+openId);
        Map<String,String> map=new HashMap<>();
        map.put("openId",openId);
        return map;
    }
}
